package com.stock_t.dto;

import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Data
public class StockStatisticsResponse {
    private StockInfo stockInfo;
    private LatestData latestData;
    private List<ShareItem> shareComposition;
    private List<BreakEvenItem> breakEvenPrices;
    private ProfitSummary profitSummary;
    private ShareSummary shareSummary;
    private List<MonthlyProfit> monthlyProfits;
    private PriceDistribution priceDistribution;

    @Data
    public static class StockInfo {
        private String stockCode;
        private String stockName;
    }

    @Data
    public static class LatestData {
        private Integer totalShares;
        private BigDecimal tProfit;
        private BigDecimal breakEvenPrice;
        private BigDecimal currentPrice;
        private BigDecimal profitLoss;
        private BigDecimal marketValue;
        // 时间
        private String date;
        // 做T次数
        private String numberTrades;
        // 成功率
        private String successRate;
    }

    @Data
    public static class ShareItem {
        private Integer shares;
        private BigDecimal price;
    }

    @Data
    public static class BreakEvenItem {
        private Integer shares;
        private BigDecimal breakEvenPrice;
    }

    // 股数统计
    @Data
    public static class ShareSummary {
        // 最大股数
        private Integer maxTotalShares;
        // 最小股数
        private Integer minTotalShares;
        // 当前股数
        private Integer currentTotalShares;
    }

    @Data
    public static class ProfitSummary {
        private BigDecimal totalTProfit;
        private BigDecimal currentMonthTProfit;
        private BigDecimal maxMonthlyTProfit;
        private BigDecimal maxTProfit;
        private BigDecimal minTProfit;
    }

    @Data
    public static class MonthlyProfit {
        private String month;
        private BigDecimal profit;
    }

    @Data
    public static class PriceDistribution {
        private List<Map<String, Object>> priceDaysList;  // 改为List
        private Integer daysWithCurrentPrice;
        private Integer totalRecords;
    }
}